import axios from 'axios'
import { request } from '@/utils/request'

//首页 个人职位分页数据
export function GetPagedList(data) {
    const url = request.baseURL + '/api/wap/jobs/Index';
    return axios.get(url, {
        params: data
    }).then((res) => {
        return Promise.resolve(res.data);
    });
};

//首页 公司职位分页数据
export function GetRecruitList(data) {
    const url = request.baseURL + '/api/wap/jobs/Recruit';
    return axios.get(url, {
        params: data
    }).then((res) => {
        return Promise.resolve(res.data);
    });
};


//职位 详情页 
export function GetDetail(id) {
    const url = request.baseURL + '/api/wap/jobs/detail';
    const data = {
        id:id,
        callback: 'callback'
    };
    return axios.get(url, {
        params: data
    }).then((res) => {
        return Promise.resolve(res.data);
    });
};


//职位 评论列表项
export function getComments(id) {
    const url = request.baseURL + '/api/wap/jobs/Comments';
    const data = {
        id:id,
        callback: 'callback'
    };
    return axios.get(url, {
        params: data
    }).then((res) => {
        return Promise.resolve(res.data);
    });
};


//职位 推荐职位
export function getRecommendJob(id) {
    const url = request.baseURL + '/api/wap/jobs/RecommendJob';
    const data = {
        id:id,
        callback: 'callback'
    };
    return axios.get(url, {
        params: data
    }).then((res) => {
        return Promise.resolve(res.data);
    });
};
//投递简历
export function Delivery(uid,id) {
    const data={
        uid:uid,
        id:id
    };
    const url = request.baseURL + '/api/user/job/Delivery';
    return axios.post(url,data).then((res) => {
        return Promise.resolve(res.data);
    });
};


